package com.postracker.initdatabase.io.util;

import java.net.URL;

import org.apache.commons.lang.StringUtils;

public final class Resources {

	private static final Resources INSTANCE = new Resources();

	public static Resources getInstance() {
		return INSTANCE;
	}

	public String getAbsolutePath(String relativePath) {
		if (StringUtils.isEmpty(relativePath)) {
			return StringUtils.EMPTY;
		}
		URL resource = this.getClass().getResource(relativePath);
		if (resource == null) {
			return StringUtils.EMPTY;
		}
		return resource.getPath();
	}

}
